
package com.tencent.weibo.api
{
	import com.tencent.weibo.log.LevelLogger;
	import com.tencent.weibo.operation.IRequestOperation;
	import com.tencent.weibo.operation.URLRequestOperation;
	
	import flash.events.IEventDispatcher;
	
	import mx.logging.ILogger;
	
	/**
	 * Tag相关的API
	 * @langversion 3.0
	 * @playerversion Flash 9
	 * @playerversion AIR 1.1
	 *
	 */
	public class Tag extends AbstractAPI
	{
		/**
		 * 日志输出对象
		 */
		public static var logger:ILogger=LevelLogger.getLogger("com.tencent.weibo.api.Tag");
		
		/**
		 * 1.添加标签
		 * @param tag 标签内容
		 * @return IRequestOperation实例
		 */		
		public function add(tag:String):IRequestOperation
		{
			checkAccessToken();
			var url:String = config.urlBase+"tag/add";
			var attachParms:Object = {};
			attachParms.tag = tag;
			return generateDataRequest(url,attachParms,"POST");
		}
		/**
		 * 2.删除标签
		 * @param tagid 标签ID
		 * @return IRequestOperation实例
		 */		
		public function del(tagid:String):IRequestOperation
		{
			checkAccessToken();
			var url:String = config.urlBase+"tag/del";
			var attachParms:Object = {};
			attachParms.tagid = tagid;
			return generateDataRequest(url,attachParms,"POST");
		}
	}
}